#include "archtypestab.h"


ArchtypesTab::ArchtypesTab(QTableView* archview,QWidget *parent) :
    QWidget(parent),m_archview(archview)
{
    QVBoxLayout* main_layout = new QVBoxLayout;
    QHBoxLayout* buttons_layout = new QHBoxLayout;

    QPushButton* add_button = new QPushButton("Add");

    QPushButton* copy_button = new QPushButton("Copy");
    QPushButton* remove_button = new QPushButton("Remove");

    buttons_layout->addWidget(add_button);
    buttons_layout->addWidget(copy_button);
    buttons_layout->addWidget(remove_button);

    main_layout->addLayout(buttons_layout);
    main_layout->addWidget(m_archview);
    m_archview->horizontalHeader()->setResizeMode(QHeaderView::Stretch);


    this->setLayout(main_layout);


    connect(add_button,SIGNAL(clicked()),this,SLOT(Add()));
    connect(copy_button,SIGNAL(clicked()),this,SLOT(Copy()));
    connect(remove_button,SIGNAL(clicked()),this,SLOT(Delete()));
}

void ArchtypesTab::Add(){
    emit AddPressed();
}

void ArchtypesTab::Copy(){
    emit CopyPressed();
}

void ArchtypesTab::Delete(){
    emit DeletePressed();
}
